package cn.iocoder.yudao.module.erp.dal.mysql.warehouseinlist;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouseinlist.WarehouseInListDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.erp.controller.admin.warehouseinlist.vo.*;

/**
 * ERP 入库单表（一二级库） Mapper
 *
 * @author 管理员
 */
@Mapper
public interface WarehouseInListMapper extends BaseMapperX<WarehouseInListDO> {

    default PageResult<WarehouseInListDO> selectPage(WarehouseInListPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseInListDO>()
                .eqIfPresent(WarehouseInListDO::getInId, reqVO.getInId())
                .eqIfPresent(WarehouseInListDO::getOutDeptId, reqVO.getOutDeptId())
                .eqIfPresent(WarehouseInListDO::getInDeptId, reqVO.getInDeptId())
                .betweenIfPresent(WarehouseInListDO::getInTime, reqVO.getInTime())
                .eqIfPresent(WarehouseInListDO::getStatus, reqVO.getStatus())
                .eqIfPresent(WarehouseInListDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(WarehouseInListDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WarehouseInListDO::getId));
    }

}